package com.cq.hd.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cq.hd.order.api.dto.GroupBuyOrderPageDto;
import com.cq.hd.order.api.vo.GroupBuyOrderNumStatVo;
import com.cq.hd.order.api.vo.GroupBuyOrderPageVo;
import com.cq.hd.order.po.TbGroupBuyOrderPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TbGroupBuyOrderMapper extends BaseMapper<TbGroupBuyOrderPo> {

    int increaseCurrentNum(Long id);

    int subCurrentNum(Long id);

    // 查询待成团，可直接参团的拼团订单
    List<TbGroupBuyOrderPo> selectPendingGroups(@Param("activeId") Long activeId);

    // 统计活动订单数量（开团、成团数量）
    List<GroupBuyOrderNumStatVo> statisticsGroupOrderNumByActiveIds(@Param("activeIds") List<Long> activeIds);

    List<GroupBuyOrderPageVo> selectPageByDto(GroupBuyOrderPageDto groupBuyOrderPageDto);

    List<TbGroupBuyOrderPo> selectExpiredGroupBuyOrders();

}
